import React, { Component } from "react";
import proptypes from 'prop-types'
import Chill from './chiid1'
class chi extends Component {
  static proptypes = {
    role: proptypes.string.isRequired
  }
  render () {
    const { role, userinfo } = this.props
    return (
      <div>
        父组件
        {
          role === 'admin' ? (
            <div>
              {Object.keys(userinfo).map(k => {
                return (<div key={k}>
                  {k}-{userinfo[k]}
                </div>)
              })}
            </div>):'没有权限'
        }
        <Chill username={this.props.username}></Chill>
      </div>
    );
  }
}

export default chi;